Over recent years, computer graphic rendering technology has experienced rapid development. Correspondingly, computer graphic rendering technology has found wide application in various fields, such as the film industry, computer games industry, and the like. In three-dimensional (3D) graphics, an object is formed by a plurality of primitives. A graphic rendering system transforms the object from an object space sequentially into a world space, a camera space and then, through projection, into a screen space.
In camera space, the graphic rendering system defines a view volume 10, as shown in FIG. 1A. Since an object outside the view volume 10 will not be rendered in the screen space, clipping primitives must be performed by the general graphic rendering system. Furthermore, to avoid the problems caused when an object is placed too close to the camera or is disposed behind the camera, clipping must also be done on a near clipping plane 10a of the view volume 10 in the graphic rendering system. Specifically, when the object is too close to the camera, a problem of dividing by zero may occur. Besides, when the object is disposed behind the camera, the primitives may be flipped into the wrong area, as shown in FIG. 1B.
To avoid the aforesaid problems, a conventional graphic rendering system clips the primitives of an object with reference to the six planes of the view volume. In more details, when a primitive is a triangle and the triangle is clipped against to a plane of the view volume, one of the following four cases will occur: (a) the entire triangle 12 is outside the view volume 10 as shown in FIG. 1C, so the entire triangle 12 will be discarded; (b) the entire triangle 14 is inside the view volume 10 as shown in FIG. 1D, so the entire triangle 14 will be retained; (c) one of the vertices of the triangle 16 is inside the view volume 10 and the other two vertices of the triangle 16 are outside the view volume 10, in which case the triangle 16 will be clipped but no new triangle is generated as shown in FIG. 1E; and (d) two vertices of the triangle 18 are inside the view volume 10 and the other vertex is outside the view volume 10, in which case the triangle 18 will be clipped to generate new triangles 18a, 18b as shown in FIG. 1F. Additionally, if a triangle extends across more than one plane of the view volume, it is possible that multiple triangles will be generated.
The individual triangles obtained by clipping the object are then transformed into the screen space by the conventional graphic rendering system. Specifically, the individual triangles are transformed into a plurality of pixel points in the screen space. There are two approaches for transforming the individual triangles into a plurality of pixels in the screen space: scanning the screen space row by row or using an edge function to determine whether a pixel falls within the triangle. Since many new triangles are generated in the aforesaid clipping process, the graphic rendering system has to process more triangles in the process of transforming triangles into the pixels in the screen space. This increases the computational complexity and adds to the burden of the graphic rendering system.
Accordingly, there is still an urgent need in the art to provide a technology for projecting an object from the camera space into the screen space, which shall be able to solve the problems caused when the object is placed too close to the camera or behind the camera without the need of massive computations and without adding to the burden of the graphic rendering system.